using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using CSP.Model.CSP;

namespace CSP.DataAccess.Mapping
{
    public class ServiceAreaMap : EntityTypeConfiguration<ServiceArea>
    {
        public ServiceAreaMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Name)
                .IsRequired()
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("ServiceArea");
            this.Property(t => t.Id).HasColumnName("id");
            this.Property(t => t.Name).HasColumnName("name");
            this.Property(t => t.Parentid).HasColumnName("parentid");
            this.Property(t => t.Orderid).HasColumnName("orderid");
            this.Property(t => t.Status).HasColumnName("status");
        }
    }
}
